<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
   <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <meta name="description" content="M2M with Arduino and RasperryPi" />
   <meta name="keywords" content="M2M,Arduino,RasperryPi" />
   <meta name="author" content="Benny Saxen" />
   <link rel="stylesheet" type="text/css" href="m2m-arh.css" title="M2M-ARH" media="screen,projection" />
   <?php
include("m2mLib.php");

//session_start(); 
//$id      = $_SESSION['id'];


    $s_sec    = date('s');
    $s_min    = date('i');
    $s_hour   = date('H');
    $s_day    = date('d');
    $s_month  = date('m');
    $s_year   = date('Y');

echo("<title>All Temp Saxen</title><script src=\"processing-1.4.1.js\"></script></head>");

echo("
<STYLE type=text/css>
A:link {COLOR: blue;text-decoration:none;}
A:visited {COLOR: blue}
A:hover {COLOR: green}
BODY {COLOR: black} 
</STYLE>
");


//$_SESSION['s_year']  = $s_year;


//===================================================
// HTML
//===================================================


echo("<body>");
echo("<div align=\"center\">");
//echo("<h2>All temperatures in Saxen Home</h2>");
echo("<h2>$s_year-$s_month-$s_day $s_hour:$s_min:$s_sec</h2>");
echo("<a href=\"index.php?id=2222\">MAIN 2222</a>");

$bedroom  = readOneWire(2222,2)/100;
$heatIn   = readOneWire(2222,3)/100;
$heatOut  = readOneWire(2222,1)/100;
$fumeOut  = readOneWire(2222,4)/100;
$garage   = readOneWire(1111,2)/100;
$outdoor  = readOneWire(1111,1)/100;

echo("<table border=1>");
echo("<tr><th>Bedroom</th><th>$bedroom</th></tr>");
echo("<tr><th>Outdoor</th><th>$outdoor</th></tr>");
echo("<tr><th>Garage</th><th>$garage</th></tr>");
echo("<tr><th>Heat In</th><th>$heatIn</th></tr>");
echo("<tr><th>Heat Out</th><th>$heatOut</th></tr>");
echo("<tr><th>Fume Out</th><th>$fumeOut</th></tr>");
$temp1 = $heatOut - $heatIn;
echo("<tr><th>Energy Consumption indoor</th><th>$temp1</th></tr>");
$temp2 = $bedroom - $outdoor;
echo("<tr><th>Energy Consumption outdoor</th><th>$temp2</th></tr>");
$temp3 = $temp2/$temp1;
echo("<tr><th>Energy Consumption Coefficient</th><th>$temp3</th></tr>");
echo("</table>");
echo("<a href=\"alltemp.php\">UPDATE</a>");
echo("</div>");
echo("</body></html>"); 
?>
